<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>

        let arr1 = ['a', 'b', 'c'];
        let arr2 = [1, 2, 3, [1, 2, 3]]
        // let arr3 = arr1;
        // console.log(arr1 == arr3);
        let arr4 = [...arr2];
        console.log(arr4);//[1,2,3,[1, 2, 3]]
        console.log(arr4 == arr2);
        arr4[3][0] = 'abc';
        console.log(arr4, arr2);//[1,2,3,['abc', 2, 3]]  [1, 2, 3, ['abc', 2, 3]]

        console.log(Number.MAX_VALUE);
        console.log(Number.MIN_VALUE);

        let i = 10;
        console.log(i++ + ++i + i);//10+12+12

        // let arr5 = [10, 13, 4, 4, 7, 6, 18], arr6 = [11, 12, 4, 4, 7, 6, 8];
        //方法1
        // let arr7 = arr5.concat(arr6);
        // let s=new Set(arr7);
        // console.log(s);
        // console.log(arr7.length-s.size);
        //方法2
        // let count = 0;
        // arr5.forEach((item1) => {
        //     arr6.forEach((item2) => {

        //         if (item1 == item2) {
        //             count++
        //         }
        //     })
        // })
        // console.log(count);

        //方法三
        // let arr7 = arr5.concat(arr6);
        // let count = 0;
        // arr7.map((item, index) => {
        //     if (arr7.lastIndexOf(item) != index) {
        //         count++
        //     }

        // })

        // console.log(count);

        //方法四
        let arr5 = [10, 13, 4, 7, 6, 18], arr6 = [11, 12, 4, 7, 6, 8];
        let arr = arr5.filter(function (item) {
            //[4,7,6]
            return arr6.indexOf(item) != -1
        })
        console.log(arr.length);
//                             10,  10
        arr5.reduce(function (pre, next) {
            return pre + next
        }, 10)


        //遍历对象
        let obj = {
            name: 'zhangsan',
            age: 18,
            gender: 'male'
        }
        console.log('abc' in obj, 111);
        // console.log(Object.keys(obj));
        // console.log(Object.values(obj));
        // console.log(Object.entries(obj));

        for (let key in obj) {
            console.log(typeof key);
            console.log(obj[key]);
        }



    </script>

</body>

</html>